<template>
<x-main>
  <view class="x-box">
    <swiper class="swiper-box" :current="state.current">
      <swiper-item>
        <img style="width: 100%" :src="`${publicPath}home/banner1.png`" />
      </swiper-item>
    </swiper>

    <view class="x-full-container">
      <view @click="onRedirectOrder" class="x-btn x-btn-plain-primary">全部订单</view>
    </view>
  </view>
  <!-- 账单逾期 -->
  <x-box title="待处理账单" bgColor="#f5f5f5">
    <view class="x-normal-top">
      <x-empty :show="$emptyArray(records)"></x-empty>
      <x-bill-item :data="data" v-for="(data, index) in records" :key="index"></x-bill-item>
    </view>
  </x-box>
</x-main>
</template>

<script setup>
  import XBillItem from '@/components/logic/bill/item'
  import userStore from '@/stores/framework/user';
  import billStore from '@/stores/modules/bill';
  const BillStore = billStore();
  const UserStore = userStore();
  const {user} = storeToRefs(UserStore);
  const {billStat, records} = storeToRefs(BillStore);
  import {Helper, Msg, Constant} from "core";
  import {computed, reactive} from "vue";
  import {storeToRefs} from "pinia";
  import {onLoad} from "@dcloudio/uni-app";
  const state = reactive({
    current: 1
  })

  onLoad(async () => {
    BillStore.getList(1, 20, {orderState: Constant.BILL.KEY.OVERDUE})
  })

  const onRedirectOrder = () => {
    uni.navigateTo({url: "/pages/order/index"})
  }
</script>

<style scoped lang="less">

.x-box {
  background-color: #ffffff;
}
</style>
